import { handleActions } from 'redux-actions';
const effect = {}; // 一个全局的加载状态

export default handleActions(
  {
    SHOW_GLOBAL_LOADING(state, { payload }) {
      return {
        effect: { ...state.effect, [payload.namespace]: true },
      };
    },
    HIDE_GLOBAL_LOADING(state, { payload }) {
      return {
        effect: { ...state.effect, [payload.namespace]: false },
      };
    },
  },
  effect
);
